#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#pragma Optimize(2)

using namespace std;

const int N = 100010;
int n, a[N], cnt[N], vis[N];
priority_queue<int, vector<int>, greater<int> > s;

int main() {
	freopen("duel.in", "r", stdin);
	freopen("duel.out", "w", stdout);
	
	scanf("%d", &n);
	
	for (int i = 0; i < n; i ++ ) {
		scanf("%d", &a[i]);
		s.push(a[i]);
		cnt[a[i]] ++;
	}
	
	while(s.size() > 0) {
		int t = s.top();
		bool found = false;
		s.pop();
		int j = s.top();
		while(s.size() > 0) {
			j = s.top();
			if (j > t && (cnt[j] - vis[j]) > 0) {
				vis[j] ++ ;
				found = true;
				s.pop();
				cnt[t] -- ;
				break;
			}
			else {
				s.pop();
				continue;
			}
		}
		
		for (int i = 0; i < cnt[t]; i ++ ) {s.push(t);}
		for (int i = 0; i < cnt[j]; i ++ ) {s.push(j);}
		if (!found) break;
		
	}
		
	printf("%ld", s.size());
	return 0;
}
